home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dskut / wd.zip / DOS.H < prev    next >
C/C++ Source or Header  |  1986-06-27  |  3KB  |  108 lines

  1. /*
  2.  * dos.h
  3.  *
  4.  * Defines the structs and unions used to handle the input and output
  5.  * registers for the DOS interface routines defined in the V2.0 to V3.0
  6.  * compatability package.  It also includes macros to access the segment
  7.  * and offset values of MS C "far" pointers, so that they may be used by
  8.  * these routines.
  9.  *
  10.  * Copyright (C) Microsoft Corporation, 1984, 1985, 1986
  11.  *
  12.  */
  13.  
  14. /* word registers */
  15.  
  16. struct WORDREGS {
  17.     unsigned int ax;
  18.     unsigned int bx;
  19.     unsigned int cx;
  20.     unsigned int dx;
  21.     unsigned int si;
  22.     unsigned int di;
  23.     unsigned int cflag;
  24.     };
  25.  
  26. /* byte registers */
  27.  
  28. struct BYTEREGS {
  29.     unsigned char al, ah;
  30.     unsigned char bl, bh;
  31.     unsigned char cl, ch;
  32.     unsigned char dl, dh;
  33.     };
  34.  
  35. /* general purpose registers union - overlays the corresponding word and
  36.  * byte registers.
  37.  */
  38.  
  39. union REGS {
  40.     struct WORDREGS x;
  41.     struct BYTEREGS h;
  42.     };
  43.  
  44. /* segment registers */
  45.  
  46. struct SREGS {
  47.     unsigned int es;
  48.     unsigned int cs;
  49.     unsigned int ss;
  50.     unsigned int ds;
  51.     };
  52.  
  53. /* dosexterror struct */
  54.  
  55. struct DOSERROR {
  56.     int exterror;
  57.     char class;
  58.     char action;
  59.     char locus;
  60.     };
  61.  
  62. /* macros to break MS C "far" pointers into their segment and offset
  63.  * components
  64.  */
  65.  
  66. #define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
  67. #define FP_OFF(fp) (*((unsigned *)&(fp)))
  68.  
  69. /* function declarations for those who want strong type checking
  70.  * on arguments to library function calls
  71.  */
  72.  
  73. #ifdef LINT_ARGS    /* argument checking enabled */
  74.  
  75. #ifndef NO_EXT_KEYS    /* extended keywords are enabled */
  76. int cdecl bdos(int, unsigned int, unsigned int);
  77. int cdecl dosexterr(struct DOSERROR *);
  78. int cdecl intdos(union REGS *, union REGS *);
  79. int cdecl intdosx(union REGS *, union REGS *, struct SREGS *);
  80. int cdecl int86(int, union REGS *, union REGS *);
  81. int cdecl int86x(int, union REGS *, union REGS *, struct SREGS *);
  82. void cdecl segread(struct SREGS *);
  83. #else            /* extended keywords not enabled */
  84. int bdos(int, unsigned int, unsigned int);
  85. int dosexterr(struct DOSERROR *);
  86. int intdos(union REGS *, union REGS *);
  87. int intdosx(union REGS *, union REGS *, struct SREGS *);
  88. int int86(int, union REGS *, union REGS *);
  89. int int86x(int, union REGS *, union REGS *, struct SREGS *);
  90. void segread(struct SREGS *);
  91. #endif    /* NO_EXT_KEYS */
  92.  
  93. #else
  94.  
  95. #ifndef NO_EXT_KEYS    /* extended keywords are enabled */
  96. int cdecl bdos();
  97. int cdecl dosexterr();
  98. int cdecl intdos();
  99. int cdecl intdosx();
  100. int cdecl int86();
  101. int cdecl int86x();
  102. void cdecl segread();
  103. #else            /* extended keywords not enabled */
  104. void segread();
  105. #endif    /* NO_EXT_KEYS */
  106.  
  107. #endif    /* LINT_ARGS */
  108.